package com.an.demo.domain;

import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexId;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;

/**
 * ES数据模型
 * Copyright © 2021 xpc1024 All Rights Reserved
 *
 * @author Ann
 * @date 2024/06/01
 */
@Data
@IndexName("es_document")
public class EsDocument {
    /**
     * es中的唯一id
     */
    @IndexId
    private String id;

    /**
     * 文档标题
     */

    private String title;
    /**
     * 文档内容
     */
    @IndexField(fieldType = FieldType.TEXT,
        analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    @HighLight(preTag = "<text style='color:red'>",postTag = "</text>")
    private String articleContent;

    private String[] tags;

}
